package com.realgodo.site.entity.application.vote;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.realgodo.site.entity.IdEntity;
import com.realgodo.site.entity.space.Space;

/**
 * 投票记录表
 * @author bijiqiang E-mail: bijiqiang@gmail.com
 * @version 创建时间：2009-12-13下午03:31:59
 * @since jdk1.5
 * @version 0.1
 */
@Entity(name="VoteRecord")
@Table(name="vote_record")
public class VoteRecord extends IdEntity {

	private Date voteTime;
	private VoteItem voteItem;
	private Space voter;

	private static final long serialVersionUID = 674214081768195555L;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "vote_time", insertable = true, updatable = true)
	public Date getVoteTime() {
		return voteTime;
	}

	public void setVoteTime(Date voteTime) {
		this.voteTime = voteTime;
	}

	@ManyToOne()
	@JoinColumn(name = "vote_item_id", referencedColumnName = "id", nullable = false)
	public VoteItem getVoteItem() {
		return voteItem;
	}
	public void setVoteItem(VoteItem voteItem) {
		this.voteItem = voteItem;
	}
	
	@OneToOne()
	@JoinColumn(name = "space_id", referencedColumnName = "id", nullable = false)
	public Space getVoter() {
		return voter;
	}

	public void setVoter(Space voter) {
		this.voter = voter;
	}

	
	
}
